Optimal. Leaf size=93 \[ -\frac {2 a^2 (A-i B)}{3 c^3 f (i+\tan (e+f x))^3}-\frac {a^2 (i A+3 B)}{2 c^3 f (i+\tan (e+f x))^2}-\frac {i a^2 B}{c^3 f (i+\tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 93, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {3669, 78}
\begin {gather*} -\frac {a^2 (3 B+i A)}{2 c^3 f (\tan (e+f x)+i)^2}-\frac {2 a^2 (A-i B)}{3 c^3 f (\tan (e+f x)+i)^3}-\frac {i a^2 B}{c^3 f (\tan (e+f x)+i)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 78
Rule 3669
Rubi steps
\begin {align*} \int \frac {(a+i a \tan (e+f x))^2 (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^3} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {(a+i a x) (A+B x)}{(c-i c x)^4} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (\frac {2 a (A-i B)}{c^4 (i+x)^4}+\frac {a (i A+3 B)}{c^4 (i+x)^3}+\frac {i a B}{c^4 (i+x)^2}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {2 a^2 (A-i B)}{3 c^3 f (i+\tan (e+f x))^3}-\frac {a^2 (i A+3 B)}{2 c^3 f (i+\tan (e+f x))^2}-\frac {i a^2 B}{c^3 f (i+\tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.05, size = 81, normalized size = 0.87 \begin {gather*} \frac {a^2 ((-5 i A+B) \cos (e+f x)-(A+5 i B) \sin (e+f x)) (\cos (5 e+7 f x)+i \sin (5 e+7 f x))}{24 c^3 f (\cos (f x)+i \sin (f x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.30, size = 69, normalized size = 0.74
method | result | size |
derivativedivides | \(\frac {a^{2} \left (-\frac {-2 i B +2 A}{3 \left (i+\tan \left (f x +e \right )\right )^{3}}-\frac {i A +3 B}{2 \left (i+\tan \left (f x +e \right )\right )^{2}}-\frac {i B}{i+\tan \left (f x +e \right )}\right )}{f \,c^{3}}\) | \(69\) |
default | \(\frac {a^{2} \left (-\frac {-2 i B +2 A}{3 \left (i+\tan \left (f x +e \right )\right )^{3}}-\frac {i A +3 B}{2 \left (i+\tan \left (f x +e \right )\right )^{2}}-\frac {i B}{i+\tan \left (f x +e \right )}\right )}{f \,c^{3}}\) | \(69\) |
risch | \(-\frac {a^{2} {\mathrm e}^{6 i \left (f x +e \right )} B}{12 c^{3} f}-\frac {i a^{2} {\mathrm e}^{6 i \left (f x +e \right )} A}{12 c^{3} f}+\frac {a^{2} {\mathrm e}^{4 i \left (f x +e \right )} B}{8 c^{3} f}-\frac {i a^{2} {\mathrm e}^{4 i \left (f x +e \right )} A}{8 c^{3} f}\) | \(88\) |
norman | \(\frac {\frac {2 i A \,a^{2} \left (\tan ^{2}\left (f x +e \right )\right )}{c f}+\frac {a^{2} A \tan \left (f x +e \right )}{c f}-\frac {i A \,a^{2}+a^{2} B}{6 c f}-\frac {5 \left (-i B \,a^{2}+a^{2} A \right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3 c f}-\frac {\left (i A \,a^{2}+5 a^{2} B \right ) \left (\tan ^{4}\left (f x +e \right )\right )}{2 c f}-\frac {i B \,a^{2} \left (\tan ^{5}\left (f x +e \right )\right )}{c f}}{c^{2} \left (1+\tan ^{2}\left (f x +e \right )\right )^{3}}\) | \(157\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.08, size = 51, normalized size = 0.55 \begin {gather*} -\frac {2 \, {\left (i \, A + B\right )} a^{2} e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, {\left (i \, A - B\right )} a^{2} e^{\left (4 i \, f x + 4 i \, e\right )}}{24 \, c^{3} f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 167 vs. \(2 (75) = 150\).
time = 0.30, size = 167, normalized size = 1.80 \begin {gather*} \begin {cases} \frac {\left (- 12 i A a^{2} c^{3} f e^{4 i e} + 12 B a^{2} c^{3} f e^{4 i e}\right ) e^{4 i f x} + \left (- 8 i A a^{2} c^{3} f e^{6 i e} - 8 B a^{2} c^{3} f e^{6 i e}\right ) e^{6 i f x}}{96 c^{6} f^{2}} & \text {for}\: c^{6} f^{2} \neq 0 \\\frac {x \left (A a^{2} e^{6 i e} + A a^{2} e^{4 i e} - i B a^{2} e^{6 i e} + i B a^{2} e^{4 i e}\right )}{2 c^{3}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 165 vs. \(2 (80) = 160\).
time = 0.93, size = 165, normalized size = 1.77 \begin {gather*} -\frac {2 \, {\left (3 \, A a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 3 i \, A a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 3 \, B a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 8 \, A a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 2 i \, B a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 3 i \, A a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 3 \, B a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 3 \, A a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{3 \, c^{3} f {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i\right )}^{6}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.69, size = 87, normalized size = 0.94 \begin {gather*} \frac {\frac {a^2\,\left (A-B\,1{}\mathrm {i}\right )}{6}+\frac {a^2\,\mathrm {tan}\left (e+f\,x\right )\,\left (-3\,B+A\,3{}\mathrm {i}\right )}{6}+B\,a^2\,{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}}{c^3\,f\,\left (-{\mathrm {tan}\left (e+f\,x\right )}^3-{\mathrm {tan}\left (e+f\,x\right )}^2\,3{}\mathrm {i}+3\,\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________